<?php $this->load->view('header'); ?>

    <script type="text/javascript">
        $(document).ready(function(){
                $("#myModal").modal('show');
                $("#add_skill").click(function(){
                    var url = '<?php echo base_url()?>index.php/users/do_addUserSkill';
                    var content = $("input#user_skill").val();                    
                    $.ajax({
                        type : "POST",
                        url : url,
                        data : "skill="+content,
                        beforeSend: function(){
                        <?php $img_url = base_url()."app/css/images/load.gif" ?>
                            $("#show_result").html("<img src='<?php echo $img_url;?>' />");
                        },
                        success:function(result){
                            var kq = jQuery.parseJSON(result);
                            if(kq['msg'] == true){
                                 alert(kq['data']);
                             }else{
                                alert("loi roi");
                             }
                           
                        },
                    });// end ajax
                });// end add button click
        });
    </script>
    <div id="show_result"></div>
    <div class="modal fade" id="myModal">
       <div class="modal-dialog">
        <div class="modal-content">
          <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
            <h4 class="modal-title" id="myModalLabel">Add Skills</h4>
          </div>
          
            <input type="text" name="user_skill" id="user_skill" class="form-control" placeholder="Skills separated by commas"/>
          
          <div class="modal-footer">
            <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
            <button type="button" class="btn btn-primary" id="add_skill">Add</button>
          </div>
        </div>
      </div>
    </div><!-- /.modal -->